package TEST;

import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class Main6 {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int m=sc.nextInt();
		Queue<Integer> queA=new LinkedList<>();
		Queue<Integer> queB=new LinkedList<>();
		for(int i=0;i<m;i++){
			int x=sc.nextInt();
			if(x%2==0) queB.add(x);
			else queA.add(x);
		}
		if(queA.size()>=2*queB.size()){
			for(int i=1;!queB.isEmpty();i++){
				System.out.print(queA.poll()+" ");
				if(i%2==0) System.out.print(queB.poll()+" ");
			}
			while(queA.size()!=1) System.out.print(queA.poll()+" ");
			System.out.print(queA.poll());
		}
		if(queA.size()<2*queB.size()){
			for(int i=1;!queA.isEmpty();i++){
				System.out.print(queA.poll()+" ");
				if(i%2==0) System.out.print(queB.poll()+" ");
			}
			while(queB.size()!=1) System.out.print(queB.poll()+" ");
			System.out.print(queB.poll());
		}
	}

}
